<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>交班</title>
    <script src="../js/mui.min.js"></script>
	<link href="../css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="../css/style.css" />
	<link rel="stylesheet" href="../css/iconfont.css" />
	<link rel="stylesheet" href="../css/wallet.css" />
	  <link rel="stylesheet" href="../css/css.css" /> 
    <script type="text/javascript" charset="utf-8">
      	mui.init();
    </script>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">交班</h1>
	</header>
	<div class="mui-content">
		<div class="jiaoban_top">
			<p class="jiaoban_sjnam"></p>
			<p class="jiaoban_wz">交班收入</p>
			<p class="jiaoban_srbox">¥<em class="red" id="total_icome"></em>/<em id="counts"></em>笔</p>
			<p class="jiaoban_time">工作时间：<em id="jbtime"></em></p>
		</div>
		<ul class="mui-table-view jiaoban_nav">
			<li class="mui-table-view-cell"><a class="mui-navigate-right" onclick="remark()"><span class="fp_daog_r remark"></span>备注</a></li>
			<li class="mui-table-view-cell"><a class="mui-navigate-right" onclick="search_dg()"><span class="fp_daog_r" id="ygno">选择员工</span>交班人员</a></li>
		</ul>
		<button type="button" class="jiaoban_btn">确定</button>		  
	</div>
	<div id="search_remark" style="position:fixed;background-color:#efeff4;top:0;left:0;right:0;bottom:0;display: none;z-index: 1000;">
		<header class="mui-bar mui-bar-nav wdp_nav">
	   		<a class="mui-icon mui-icon-left-nav mui-pull-left remarkhide"></a>
	    	<h1 class="mui-title">备注</h1>
		</header>
		<nav class="mui-bar mui-bar-tab premark_tab">
		    <a class="remarkhide">取消</a>
		    <a class="remarkquey">确定</a>
		</nav>
		<div class="mui-content payremark">
		    <div class="payremark_box">
		    	<textarea placeholder="添加备注" id="remarkinfo"></textarea>
		    </div>
		</div>
	</div>
	<!--导购界面-->
	<div id="search_dg" style="position:fixed;background-color:#efeff4;top:0;left:0;right:0;bottom:0;display: none;z-index: 1000;">
		<header class="mui-bar mui-bar-nav wdp_nav">
		    <a class="mui-icon mui-icon-left-nav mui-pull-left" id="dghide"></a>
		    <h1 class="mui-title">员工</h1>
		</header>
			<div class="mui-content">
		<div class="jiaoban_btbox clearfix">
			<div class="name">姓名</div>
			<div class="phonenum">手机号码</div>
			<div class="gonghnum">工号</div>
			<div class="choice">选择</div>
		</div>
		<form class="mui-input-group jiaoban_memlist">
			
		</form>
		<button type="button" class="jiaoban_membtn">确定</button>  
	</div>

		<nav class="mui-bar mui-bar-tab">
		   
		    <a class="mui-table-cell fastpay_tabr qr" style="text-align:center;padding-top: 10px;">
		        <span class="mui-tab-label" >确认</span>
		    </a>
		</nav>
		</div>
	
</body>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/layer/layer.min.js"></script>
<script type="text/javascript" src="../js/app.js"></script>
<script>
		
	//备注
	function remark(){
		$("#search_remark").show();
	}
	$(".jiaoban_btn").click(function(){
		var no=$("#ygno").text();
		if(no==""||no=='选择员工'){
			layer.msg('请选择员工');
			return;
		}
		$.ajax({
			type:"post",
			url: APP.api_url + 'agent/jiaoban',
			data:{
				no:no,
				chain_id:getValueByName("chain_id"),
				total_icome:$("#total_icome").text()
			},
			success:function(data){
				layer.msg(data.msg);
				if(data.code==200){
					window.location.href="chain.html";
				}
			}
		});
		
	})
	//确认导购
	$(".qr").click(function(){
		var val=$('input:radio[name="radio1"]:checked').val();
		if(val==null||val==''){
			layer.msg("请选择员工");
			return false;
		}
		$("#ygno").text(val);
		$("#search_dg").hide();
		$("#dginfo").show();
	});
	//隐藏备注
	$(".remarkhide").click(function(){
		$("#search_remark").hide();
	})
	$.ajax({
		type:"post",
		url: APP.api_url + 'agent/get_employ',
		data:{
			chain_id:getValueByName("chain_id")
		},
		success:function(data){
			var emps=data.emps;
			$(".jiaoban_sjnam").text(data.name);
			$("#total_icome").text(data.sums);
			$("#counts").text(data.counts);
			$("#jbtime").text(data.jbtime);
			if(emps){
				var html="";
				for(var i in emps){
					var e=emps[i];
					html+='<div class="mui-input-row mui-radio clearfix">'+
					'<div class="name">'+e.name+'</div>'+
					'<div class="phonenum">'+e.mobile+'</div>'+
					'<div class="gonghnum">'+e.no+'</div>'+
					'<div class="choice"><input name="radio1" value='+e.no+' type="radio"></div>'+
					'</div>';
				}
				$(".jiaoban_memlist").html(html);
			}
		}
	});
	//确认备注
	$(".remarkquey").click(function(){
		$("#search_remark").hide();		
		var remarkinfo = $("#remarkinfo").val();
		$(".remark").text(remarkinfo);
	})
	//选择导购
	function search_dg(){
		$("#search_dg").show();		
	}
	
	//隐藏导购界面
	$("#dghide").click(function(){
		$("#search_dg").hide();
	})
</script>
</html>
